/*
 * 系统项目名称：综合决策分析系统-version2.0
 * 文件名：AnaImportDataDaoImpl.java
 * 描述：
 * 版权：Copyright 2015-2020 义乌市跨境电商供应链管理有限公司-版权所有
 * 修改人：yangjx
 * 修改时间：2016-3-17 上午9:13:25
 * 版本号：V1.1
 */
package com.ywt.cda.dao.impl;

import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.apache.ibatis.session.SqlSession;
import org.springframework.stereotype.Repository;

import com.ywt.cda.core.dao.page.Page;
import com.ywt.cda.dao.AnaImportDataDao;
import com.ywt.cda.domain.Ana2ndData;
import com.ywt.cda.domain.AnaImportData;

/**
 * （一句话功能简述） <br>
 * （功能详细描述）
 * 
 * @author yangjx
 * @version V1.0
 * @see [相关类/方法]
 * @since 2016-3-17 上午9:13:25
 */
@Repository("anaImportDataDao")
public class AnaImportDataDaoImpl implements AnaImportDataDao {
	@Resource(name = "sqlSession")
	private SqlSession sqlSession;

	@Override
	public List<AnaImportData> listOrderBy(Map<String, Object> params, Page page) {
		if (null == page) {
			return sqlSession.selectList("AnaImportData.listOrderBy", params);
		}
		return sqlSession.selectList("AnaImportData.listOrderBy", params, page);

	}

	@Override
	public List<AnaImportData> total(Map<String, Object> params, Page page) {
		if (null == page) {
			return sqlSession.selectList("AnaImportData.total", params);
		}
		return sqlSession.selectList("AnaImportData.total", params, page);
	}

	@Override
	public List<AnaImportData> listTotalDataByParamsAndPage(
			Map<String, Object> params, Page page) {
		if (null == page) {
			return sqlSession.selectList("AnaImportData.totalByParams", params);
		}
		return sqlSession.selectList("AnaImportData.totalByParams", params,
				page);
	}

	@Override
	public List<AnaImportData> listTotalSku(Map<String, Object> params,
			Page page) {
		if (null == page) {
			return sqlSession.selectList("AnaImportData.totalSku", params);
		}
		return sqlSession.selectList("AnaImportData.totalSku", params, page);
	}


	@Override
	public List<Ana2ndData> listPort(Map<String, Object> parms) {
		return sqlSession.selectList("AnaImportData.listPort", parms);
	}


	public List<AnaImportData> listByProvince(Map<String, Object> params) {

		return sqlSession.selectList("AnaImportData.listbyProvince", params);
	}

	@Override
	public Long getAllProvinceSumNum(Map<String, Object> params) {
		Long sumNum = sqlSession.selectOne("AnaImportData.allProvinceSumNum", params);
		return null == sumNum?0l:sumNum;
	}


	@Override
	public List<AnaImportData> listData(Map<String, Object> params) {
		
		return sqlSession.selectList("AnaImportData.listData", params);
	}

	@Override
	public List<String> getItemNameListByKeyword(Map<String, Object> params) {
		return sqlSession.selectList("AnaImportData.listbyItemName", params);
	}

	@Override
	public List<Ana2ndData> listShopData(Map<String, Object> params, Page page) {
		if (null == page) {
			return sqlSession.selectList("AnaImportData.listShopData", params);
		}
		return sqlSession.selectList("AnaImportData.listShopData", params, page);
		//return sqlSession.selectList("AnaImportData.listShopData", params);
	}
	@Override
	public List<Ana2ndData> listNianData(Map<String, Object> params) {
		
		return sqlSession.selectList("AnaImportData.listShopNianData", params);
	}


	@Override
	public List<AnaImportData> listTotalDataByParamsAndGoods(Map<String, Object> params) {
		return sqlSession.selectList("AnaImportData.total3rdByParams", params);
	}


}
